﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace Oiler
{
    public class Employees
    {
        Random rnd = new Random();
        List<Executive> execs = new List<Executive>();

        //List of Potential Executive names
        List<string> names = new List<string>(new string[] {
            "Brian Aarhus", "Ryan Mayo" , "Andrew Wirth", "Gerald Dominquez", "Will Creekmore", "Paul Horning",
            "Sylvia Caruther", "Leticia Meredith", "June Wilkens", "Mosqueda Cullens", "Brian Burrus", "John Hodgkins",
            "Anne Michalak", "Bryan Buchan", "Chris Owen", "Steve Isacon", "Corey Paradise", "Eric Marston",
            "Michael Lanham", "Timothy Omalley", "Anne Toner", "Benjamin Eggers", "Toni Boiset", "Patrick Walters",
            "Natasha Rives", "Terry Frances", "Joe Bulluzio", "Elaine Mullin", "Bruce Araujo", "Rodney Mardis", 
            "Audrey Beauregard", "Henry Germain", "Gerard David", "Julie Marie", "Jonathan Erick", "Donna Perry"
        });

        public void Initialize()
        {

        }

        public void Update()
        {
            //Creates Potential executives
            if (execs.Count < 4)
            {
                int randName = rnd.Next(0, 5);
                int randWage = rnd.Next(20, 101);
                execs.Add(new Executive(names[randName], randWage * 1500, randWage/rnd.Next(5,20), randWage*(rnd.Next(5, 16) * 10)));
                names.RemoveAt(randName);
            }
            
        }

        public void Draw(SpriteBatch spriteBatch, SpriteFont gameFont, Canvas employCan)
        {
            //while the potential employee list page is open, draw the list of the executives
            //and their attributes
            if(employCan.Visibility == Visibility.Visible)
            {
                spriteBatch.DrawString(gameFont, execs[0].ExecPlate, new Microsoft.Xna.Framework.Vector2(100, 100), Microsoft.Xna.Framework.Color.White);
                spriteBatch.DrawString(gameFont, execs[1].ExecPlate, new Microsoft.Xna.Framework.Vector2(100, 140), Microsoft.Xna.Framework.Color.White);
                spriteBatch.DrawString(gameFont, execs[2].ExecPlate, new Microsoft.Xna.Framework.Vector2(100, 180), Microsoft.Xna.Framework.Color.White);
                spriteBatch.DrawString(gameFont, execs[3].ExecPlate, new Microsoft.Xna.Framework.Vector2(100, 220), Microsoft.Xna.Framework.Color.White);
            }
        }
    }
}
